<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
<link rel="stylesheet" href="script/bootstrap-3.3.7.min.css">

  <title>百叶窗特效（Blind Effect）演示</title>
  <link rel="stylesheet" href="script/jquery-ui.1.10.4.css">  <!-- 注意顺序-->
  <style>
  #tog {
    text-align: center;
    width: 100px;
    height: 100px;
    background: #ccc;
  }
  </style>
  <script src="script/jquery-1.10.min.js"></script>
  <script src="script/jquery-ui.1.10.4.min.js"></script>
</head>

<!-- 特效网页 淡入淡出，膨胀，缩放，调整尺寸等效果 https://www.runoob.com/jqueryui/api-toggle.html -->

<!-- 控制特效的出现，消失，元素添加class 等 https://www.runoob.com/jqueryui/ref-effects-core.html -->
<body>
<div class="container">
  <div class="row">
    <button id = "tog_blind"> 百叶窗 </button>
    <button id = "tog_fold"> 折叠(类似百叶窗) </button>
    <button id = "tog_bounce"> 反弹 </button>
    <button id = "tog_clip"> 剪辑 </button>
    <button id = "tog_animate"> 改变颜色 </button>
    <button id = "effect_add"> 任意元素添加特效 </button>
    <button id = "tog_drop"> 消失 </button>
  </div>

 <div class="row">
    <div id="tog">
      <h2>测试</h2>
    </div> 
    <!-- 颜色style -->
  </div>

  <div class="row">
      <div class="col-md-3" style="margin-bottom: 10px;margin-top: 20px;" >

        <div id="elem"></div> <!-- 进度条 -->

      </div>
  </div>

</div>
<script>


$( "#elem" ).progressbar(); //创建进度条
$( "#elem" ).progressbar( "option", { //进度条参数
    value: 70,
    // disabled: true
});


  $("#effect_add").click(function(){

    $( "#elem" ).effect( "bounce", "slow" );

  })


$( "#tog_blind" ).click(function() {
    $( "#tog" ).toggle( "blind" ,1000);
  $( "#tog" ).toggle( "blind" ,1000,function(){  // blind 百叶窗特效
  alert("完成百叶窗")
  });

});


$( "#tog_bounce" ).click(function() {
    $( "#tog" ).toggle( "bounce" ,'fast');
  $( "#tog" ).toggle( "bounce" ,{ times: 3 },'fast',function(){  // blind 百叶窗特效,反弹次数，距离见参数
  alert("完成反弹")
  });
});

$( "#tog_clip" ).click(function() {
    $( "#tog" ).toggle( "clip" ,1000);
  $( "#tog" ).toggle( "clip" , 'vertical' ,'slow',function(){  //  vertical 剪辑上下边缘，horizontal 剪辑左右边缘。
  alert("完成剪辑")
  });
});

$( "#tog_animate" ).click(function() {
  $( "#tog" ).animate({  //option https://www.runoob.com/jqueryui/api-color-animation.html
    color: "green",
    backgroundColor: "rgb( 20, 20, 20 )"
  });
});

$( "#tog_fold" ).click(function() {
   $( "#tog" ).toggle( "fold" ,'fast');
  $( "#tog" ).toggle( "fold"  ,'slow',function(){  // option https://www.runoob.com/jqueryui/api-fold-effect.html
    alert("完成折叠")
  });
});

$( "#tog_drop" ).click(function() {
   $( "#tog" ).toggle( "drop" ,1000);
  $( "#tog" ).toggle( "drop" ,1000,function(){  // up、down、left、right
    alert("完成消失")
  });
});
</script>
 
</body>
</html>